package com.jash.designpack;

import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.View;

public class MyBehavior extends CoordinatorLayout.Behavior {
    public MyBehavior() {
    }

    public MyBehavior(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) {
        if (dependency.getId() == R.id.main_tv_1) {
            ViewCompat.setX(child, dependency.getLeft());
            ViewCompat.setY(child, dependency.getBottom());
        }
        return dependency.getId() == R.id.main_tv_1;
    }
}
